/**
 * Created with IntelliJ IDEA
 * Description:
 * User:恋恋
 * Date:2022-03-20
 * Time:11:46
 */
public class Test {
    public static void main(String[] args) {
        int[] arr=new int[]{1,2,3,4,5};
        pri(arr,0);
    }
    public static void pri(int[] arr,int len){
        //循环起始地址作为递归的终止条件
        if(len== arr.length-1)
        {
            System.out.println(arr[arr.length-1]);
        }
        pri(arr,len+1);
        System.out.println(arr[len]);
    }
}
